/**
 * 项目名：化工企业安全生产信息化管理平台
 * 日期：    2020-03-01 22:19:08
 * Copyright (c) 2015- -版权所有
 */

package com.joysuch.wwyt.edu.service;

import java.util.List;

import com.joysuch.wwyt.core.exception.BusinessRestrictionsException;
import com.joysuch.wwyt.edu.bean.EduRandomSelectQuestionBean;
import com.joysuch.wwyt.edu.bean.EduRandomSelectQuestionConfig;
import com.joysuch.wwyt.edu.bean.EduTestPaperDetailBean;
import com.joysuch.wwyt.edu.bean.EduTestPaperEditBean;
import com.joysuch.wwyt.edu.bean.EduTestPaperListBean;
import com.joysuch.wwyt.edu.bean.EduTestPaperListBean.SearchEduTestPaper;
import com.joysuch.wwyt.edu.bean.EduTestPaperQuestionDetailBean;
import com.joysuch.wwyt.edu.entity.EduTestPaper;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;

public interface EduTestPaperService {

    public EduTestPaper add(EduTestPaperEditBean entity);

    void update(EduTestPaperEditBean entity);

    Page<EduTestPaperListBean> findByPage(Pageable page, SearchEduTestPaper condition);

    Boolean checkTestPaperContainZgt(EduTestPaper testPaper);

    void delete(Long id) throws BusinessRestrictionsException;

    EduTestPaperDetailBean getById(Long id,Long userId);

    EduTestPaper findById(Long id);

    public List<EduRandomSelectQuestionBean> randomSelectQuestions(Long testPaperId,
            List<EduRandomSelectQuestionConfig> configs);

    public List<EduTestPaperQuestionDetailBean> getQuestionList(Long id,Long userId);

    public List<EduTestPaperQuestionDetailBean> getQuestionList(Long id, boolean includeItems,Long userId);

    public List<EduTestPaperQuestionDetailBean> getQuestionList(Long id, boolean includeItems, Long userId, Long examId, List<Long> testPaperQuestionIds);

    void validateConfigRules(List<EduRandomSelectQuestionConfig> configs);

    /**
     * 根据考试的id查询对应的试卷
     * @param examId
     * @return
     */
    EduTestPaper findByExamId(Long examId);

    void paperExcel(Long id,Integer type, HttpServletResponse response);

    Page<EduTestPaperListBean> findByWebPage(Pageable page, SearchEduTestPaper condition);
}
